package com.wxapp.common.util.feign.feign;

import com.wxapp.common.constant.constant.LoginConstant;
import com.wxapp.common.constant.pojo.vm.ResultVm;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.*;

public interface DynamicFeign {

    @PostMapping("{url}")
    ResultVm<Object> executePostApi(@PathVariable("url") String url, @RequestHeader(LoginConstant.INTERNAL_TOKEN_KEY) String token, @RequestBody Object params);

    @GetMapping("{url}")
    ResultVm<Object> executeGetApi(@PathVariable("url") String url, @RequestHeader(LoginConstant.INTERNAL_TOKEN_KEY) String token, @SpringQueryMap Object params);

    @DeleteMapping("{url}")
    ResultVm<Object> executeDeleteApi(@PathVariable("url") String url, @RequestHeader(LoginConstant.INTERNAL_TOKEN_KEY) String token, @RequestBody Object params);

    @PutMapping("{url}")
    ResultVm<Object> executePutApi(@PathVariable("url") String url, @RequestHeader(LoginConstant.INTERNAL_TOKEN_KEY) String token, @RequestBody Object params);
}